package com.macro.mall.controller;

import com.macro.mall.common.api.CommonPage;
import com.macro.mall.common.api.CommonResult;
import com.macro.mall.dto.BmsMuseumTeamDetail;
import com.macro.mall.dto.BmsMuseumTeamParam;
import com.macro.mall.model.BmsMuseumTeam;
import com.macro.mall.service.BmsMuseumTeamService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Controller
@Api(tags = "BmsMuseumTeamController")
@Tag(name = "BmsMuseumTeamController", description = "文博项目-报名")
@RequestMapping("/museumTeam")
public class BmsMuseumTeamController {

    @Autowired
    private BmsMuseumTeamService bmsMuseumTeamService;

    @ApiOperation("分页查询文博项目团队-报名")
    @RequestMapping(value = "/list", method = RequestMethod.POST)
    @ResponseBody
    public CommonResult<CommonPage<BmsMuseumTeam>> getList(@RequestBody BmsMuseumTeamParam bmsMuseumTeamParam) {
        List<BmsMuseumTeam> bmsMuseumTeamList = bmsMuseumTeamService.getList(bmsMuseumTeamParam);
        return CommonResult.success(CommonPage.restPage(bmsMuseumTeamList));
    }

    @ApiOperation("根据id获取文博项目团队-报名信息")
    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
    @ResponseBody
    public CommonResult<BmsMuseumTeamDetail> getItem(@PathVariable Long id) {
        BmsMuseumTeamDetail bmsMuseumTeamDetail = bmsMuseumTeamService.getItem(id);
        return CommonResult.success(bmsMuseumTeamDetail);
    }



}
